fhg2a.relogo
[Groovy] Class Tribe

java.lang.Object
  fhg2a.ReLogoTurtle
      Tribe

abstract class Tribe
extends ReLogoTurtle

Abstract turtle forming the basis for all tribes (agents). All tribes reproduce and cull according to the same rules and these methods are therefore defined here. Foraging and movement algorithms must be implemented by each extending class.


Property Summary
java.lang.Object births

java.lang.Object deaths

java.lang.Object migrations

java.lang.Object populationSize

 
Method Summary
java.lang.Object agentOnDesert()

Determine the number of agents on patch (if patch is desert).

java.lang.Object agentOnLush()

Determine the number of agents on patch (if patch is lush).

java.lang.Object agentOnMiddle()

Determine the number of agents on patch (if patch is middle habitat).

java.lang.Object birthsOnDesert()

Determine the number of births on patch (if patch is desert).

java.lang.Object birthsOnLush()

Determine the number of births on patch (if patch is lush).

java.lang.Object birthsOnMiddle()

Determine the number of births on patch (if patch is middle habitat).

java.lang.Object cull(java.lang.Object availableEnergy)

Cull population to maximum size that can be sustained by energy gathered.

java.lang.Object deathsOnDesert()

Determine the number of deaths on patch (if patch is desert).

java.lang.Object deathsOnLush()

Determine the number of deaths on patch (if patch is lush).

java.lang.Object deathsOnMiddle()

Determine the number of deaths on patch (if patch is middle habitat).

java.lang.Object forage()

All extending classes must implement a foraging algorithm.

java.lang.Object migrationsToDesert()

Determine the number of migrations by this agent (if patch is desert).

java.lang.Object migrationsToLush()

Determine the number of migrations by this agent (if patch is lush).

java.lang.Object migrationsToMiddle()

Determine the number of migrations by this agent (if patch is middle habitat).

java.lang.Object move()

All extending classes must implement an algorithm for deciding whether or not to move, and to which patch.

java.lang.Object reproduce(java.lang.Object tribeType)

Increase population of tribe.

java.lang.Object reset()

Sets a tribe's population back to the default (20 individuals).

java.lang.Object step(java.lang.Object tribeType)

Execute tribe's yearly cycle of activity in a fixed order: reproduce, decide whether to move to a new patch, forage for food.

 

Property Detail

births

java.lang.Object births


deaths

java.lang.Object deaths


migrations

java.lang.Object migrations


populationSize

java.lang.Object populationSize


 
Method Detail

agentOnDesert

java.lang.Object agentOnDesert()
Determine the number of agents on patch (if patch is desert).
Returns:
Number of agents if habitat is desert, or 0 otherwise.


agentOnLush

java.lang.Object agentOnLush()
Determine the number of agents on patch (if patch is lush).
Returns:
Number of agents if habitat is lush, or 0 otherwise.


agentOnMiddle

java.lang.Object agentOnMiddle()
Determine the number of agents on patch (if patch is middle habitat).
Returns:
Number of agents if habitat is middle, or 0 otherwise.


birthsOnDesert

java.lang.Object birthsOnDesert()
Determine the number of births on patch (if patch is desert).
Returns:
Number of births if habitat is desert, or 0 otherwise.


birthsOnLush

java.lang.Object birthsOnLush()
Determine the number of births on patch (if patch is lush).
Returns:
Number of births if habitat is lush, or 0 otherwise.


birthsOnMiddle

java.lang.Object birthsOnMiddle()
Determine the number of births on patch (if patch is middle habitat).
Returns:
Number of births if habitat is middle, or 0 otherwise.


cull

java.lang.Object cull(java.lang.Object availableEnergy)
Cull population to maximum size that can be sustained by energy gathered.
Parameters:
availableEnergy - Amount of energy available to support the tribe population.


deathsOnDesert

java.lang.Object deathsOnDesert()
Determine the number of deaths on patch (if patch is desert).
Returns:
Number of deaths if habitat is desert, or 0 otherwise.


deathsOnLush

java.lang.Object deathsOnLush()
Determine the number of deaths on patch (if patch is lush).
Returns:
Number of deaths if habitat is lush, or 0 otherwise.


deathsOnMiddle

java.lang.Object deathsOnMiddle()
Determine the number of deaths on patch (if patch is middle habitat).
Returns:
Number of deaths if habitat is middle, or 0 otherwise.


forage

java.lang.Object forage()
All extending classes must implement a foraging algorithm.


migrationsToDesert

java.lang.Object migrationsToDesert()
Determine the number of migrations by this agent (if patch is desert).
Returns:
Number of agents if habitat is desert, or 0 otherwise.


migrationsToLush

java.lang.Object migrationsToLush()
Determine the number of migrations by this agent (if patch is lush).
Returns:
Number of agents if habitat is lush, or 0 otherwise.


migrationsToMiddle

java.lang.Object migrationsToMiddle()
Determine the number of migrations by this agent (if patch is middle habitat).
Returns:
Number of agents if habitat is middle, or 0 otherwise.


move

java.lang.Object move()
All extending classes must implement an algorithm for deciding whether or not to move, and to which patch.


reproduce

java.lang.Object reproduce(java.lang.Object tribeType)
Increase population of tribe. Each individual has a 2% chance of reproducing. Tribe will split into daughter tribes of size 20 if population size exceeds 39.
Parameters:
tribeType - Type of daughter tribes to generate (if any).


reset

java.lang.Object reset()
Sets a tribe's population back to the default (20 individuals).


step

java.lang.Object step(java.lang.Object tribeType)
Execute tribe's yearly cycle of activity in a fixed order: reproduce, decide whether to move to a new patch, forage for food. Also reset annual statistics.
Parameters:
tribeType - Type of daughter tribes to generate when reproducing (if any).